package Logic;
 
import java.util.List;

import Dao.MemberDAO;
import Model.MemberBean;;
 
//业务逻辑层
public class MemberLogic{
    //根据会员ID获取会员信息
    public List<MemberBean> getMember(int MemberID){
    	List<MemberBean> result = null;
        try{
            MemberDAO memberdao = new MemberDAO();
            result = memberdao.getMember(MemberID);
        }catch (Exception e){
            e.getMessage();
            result = null;
        }
        return result;
    }
    //根据会员姓名获取会员信息
    public List<MemberBean> getMemberByName(String MemberName){
    	List<MemberBean> result = null;
        try{
            MemberDAO memberdao = new MemberDAO();
            result = memberdao.getMemberByName(MemberName);
        }catch (Exception e){
            e.getMessage();
            result = null;
        }
        return result;
    }
    
    // 添加新会员
    public boolean addMember(MemberBean member){
        boolean result = false;
        try{
            MemberDAO memberdao = new MemberDAO();
            memberdao.insertMember(member);
            result = true;
        }catch (Exception e){
            e.getMessage();
            result = false;
        }
        return result;
    }  
}